using System;
using System.Collections.Generic;
using System.Text;

namespace Universe.WinForms.DropDownUI
{
    using System.Windows.Forms;

    /// <summary>
    /// 
    /// </summary>
    public class KeyInputReport : InputReport
    {
        public KeyInputReport(Keys keyData)
        {
            _KeyData = keyData;
        }
        private Keys _KeyData;
        public bool Alt
        {
            get { return ((_KeyData & Keys.Alt) == Keys.Alt); }
        }
        public bool Control
        {
            get { return ((_KeyData & Keys.Control) == Keys.Control); }
        }
        public bool Shift
        {
            get { return ((_KeyData & Keys.Shift) == Keys.Shift); }
        }
        public Keys KeyCode
        {
            get
            {
                Keys ret = _KeyData & Keys.KeyCode;
                return ((Enum.IsDefined(typeof(Keys), (int) ret) == false) ? Keys.None : ret);
            }
        }
        public Keys KeyData
        {
            get { return _KeyData; }
        }
        public int KeyValue
        {
            get { return (((int) _KeyData) & 0xffff); }
        }
        public Keys Modifiers
        {
            get { return (_KeyData & ((Keys) (-65536))); }
        }

        public override string ToString()
        {
            return this.GetType().Name + ": " + KeyData.ToString();
        }
    }
}
